package com.ruoyi.infoWeChatService;

import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelReader;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.alibaba.excel.metadata.Cell;
import com.alibaba.excel.metadata.data.CellData;
import com.alibaba.excel.read.builder.ExcelReaderBuilder;
import com.alibaba.excel.support.ExcelTypeEnum;
import com.alibaba.fastjson.JSON;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.infoCandidateScores.domain.InfoCandidateScores;
import com.ruoyi.infoCandidateScores.mapper.InfoCandidateScoresMapper;
import com.ruoyi.infoCollegial.domain.InfoCollegial;
import com.ruoyi.infoCollegial.mapper.InfoCollegialMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import javax.annotation.Resources;
import java.io.InputStream;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

@RestController
@RequestMapping("/wechat")
public class InfoWeChatController extends BaseController {

    @Resource
    private InfoCandidateScoresMapper infoCandidateScoresMapper;

    @Resource
    private InfoCollegialMapper collegialMapper;

    //查专业
    //查学校
    /*
    * 查学校查5条
    * */
    @GetMapping("/collegial")
    public AjaxResult selectCollegial(InfoCollegial collegial){
        List<InfoCollegial> collegials = collegialMapper.selectCollegialListWx(collegial);
        return AjaxResult.success(collegials);
    }

    /*
    * 一分一段查5条，可以根据年份、分数、分数区间进行查询
    * */
    @GetMapping("/scores")
    public AjaxResult selectScores(InfoCandidateScores candidateScores){
        List<InfoCandidateScores> infoCandidateScores = infoCandidateScoresMapper.selectInfoCandidateScoresListWx(candidateScores);
        return AjaxResult.success(infoCandidateScores);
    }


}
